<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ie-缓存问题的解决</title>
    <style>
      .container {
        width: 200px;
        height: 200px;
        border: 1px solid blue;
      }
    </style>
</head>
<body>
  <button>点我发送请求</button>
  <div class="container"></div>
  <script>
    var btn = document.querySelector('button');
    var container = document.querySelector('.container');
    btn.onclick = function () {
      var xhr = new XMLHttpRequest();
      //解决ie缓存问题 加一个时间戳可以解决这个问题
      xhr.open('GET','http://localhost:8000/ie?t=' + Date.now());
      xhr.send();
      xhr.onreadystatechange = function () {
        if (xhr.readyState === 4) {
          if (xhr.status >= 200 && xhr.status < 300) {
            container.innerHTML = xhr.response;
          }
        }
      }
    }
  </script>
</body>
</html>